import { createRouter, createWebHistory } from "vue-router";
import { routerlist } from "../api/testapi/getRouterList";
const routes = [
  ...routerlist,
  {
    path: "/401",
    meta: {
      hide: true,
    },
    component: () => import("@/views/error-page/401.vue"),
  },
  {
    path:"/login",
    name:"login",
    component:()=>import("@/views/Login/index.vue"),
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

//重置路由到登入页面
export const resetRouter = () => {
  router.replace("/login");
};

export default router;
